﻿using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using wsRK.BaseObject;
using wsRK.BusinessObjectHelper;

namespace nkstdgia.common.DuongKhaoSat
{
    public class GiaDoanDuongDataService : BaseDataService
    {
        #region Constructor

        public GiaDoanDuongDataService()
        {
        }

        #endregion Constructor

        public DataSet getListGiaDoanDuong(string QUAN, string strDuong)
        {
            return SqlHelper.ExecuteDataset(
                this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_getListGiaDoanDuong",
                 new SqlParameter("@QUAN", QUAN),
                new SqlParameter("@DUONG", strDuong)
                 );
        }

        public void addDoanDuong(GiaDoanDuongInfo gdd)
        {
            SqlHelper.ExecuteDataset(
                 this.strConnectring,
                  CommandType.StoredProcedure,
                  "sproc_GIA_DOAN_DUONG_Add",
                  new SqlParameter("@MA_GDD", gdd.MA_GDD),
                  new SqlParameter("@QUAN", gdd.QUAN),
                  new SqlParameter("@DUONG", gdd.DUONG),
                  new SqlParameter("@DOAN_DUONG", gdd.DOAN_DUONG),
                  new SqlParameter("@GIA_DAT", gdd.GIA_DAT),
                  new SqlParameter("@NGUOI_KHOI_TAO", gdd.NGUOI_KHOI_TAO),
                  new SqlParameter("@NGAY_KHOI_TAO", gdd.NGAY_KHOI_TAO),
                  new SqlParameter("@NGAY_CAP_NHAT", gdd.NGAY_CAP_NHAT),
                  new SqlParameter("@ACTIVE_FLAG", "Y")
                   );
        }

        public void deleteGiaDoanDuong(string MA_GDD)
        {
            SqlHelper.ExecuteDataset(
               this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_delete_GIA_DOAN_DUONG",
                new SqlParameter("@MA_GDD", MA_GDD)
                 );
        }
    }
}
